UNIX - The Series

By Fuzebox

Table of Contents
• Introduction
• Commands, instructions, and Things You Type
• Modes: what they are, and how to push them around
• hX: Installing Hotline for UNIX
• But alas, a closing

Introduction

Hey, I'm back for a third issue of Unix: TS. I seem to have received
overwhelming support from readers (all positive this time around). CYphrak from Haxor.com was happy for the advertising I gave haxor.com. Aside from the multitude of spelling
errors, last issue was pretty good. (This issue I am planning on using a spell checker.) So anyway, I'll quickly cover a few pressing issues.

Linux vs BSD, and the different shells

So far I have been proclaiming BSD as "The UNIX to use", because my two shell accounts are running BSD. However, I have found that almost everyone else has Linux shell, or is running MkLinux or LinuxPPC on their computer (maybe one day I
will get into that.) I have also found that most of the cool programs and exploit scripts will only compile without modification on a Linux system. (You can modify it I guess, but you will have to
have some programming knowledge.) It seems Linux is the Windoze 95 of UNIXes...
It's compatible with everything and used by more people, but not
necessarily better. BSD is faster and more stable, and that is a proven fact. (Sorry, Linux guys :).

I have also found that some people don't like the C shell. Well, if you know enough about another shell that you like it better, use it by all means. I'm just suggesting to you what I believe will work the best according to the directions I give you. It seems that the Bash shell is the most popular, but mainly because it is set as the default when you get an account nowadays.

Some Notes On The Bash Shell:

Hagz noted a couple of issues ago that by erasing your ".bash_history" file, you eliminate you log. However, if you use the C shell, the file you have to erase is
just called ".history". I put a neat little script into my .login file:

rm .history
cp /school/report.doc ~/.history

Ok, so all this does is replace the ".history" file with a file of my
choosing. Inside the file is clever insults and taunts at my admin, who regularly goes through everyone's history files. The reason I put this in my login file is so it is replaced every time I log in, because my admin has set up the server so it recovers the history file and puts it back in it's original position the next time I log in. Very annoying.

Also, the ".bash_profile" is called ".cshrc" in the C shell.

Commands, Instructions, and Things You Can Type

which   -    Shows you the path to a specified program.

example:

% which perl
/bin/perl

This is useful if you are using shells/perl scripts, and want to know the path to the shell/perl program.

tar 
 -
The UNIX standard for compression (Like Stuffit). Anyway,
you can use this to uncompress those file.tar files, or even
file.tar.gz files, which are also common.

example:

To uncompress a ".tar" file:
%  tar filename.tar -xf

This will decompress it and delete the original.

To uncompress a ".tar.gz" file:
%  tar filename.tar.gz -zxf

banner

- 
Takes your text and attempts to make ASCII art of
it. This only works well on some systems, so please don't complain if it doesn't work for you.

example:

% banner "Mac"

 000 000    00    00000
0   0  0   0  0   0
0   0   0  0000   0
0   0   0  0  0   0
0   0   0  0  0   00000

Note: This is a completely useless command.

Modes: What they are, and how to push them around

If you know anything about the Mac OS, you'll know that every file on your hard drive is given certain "Finder-flags". These are little bits of info that describe what kind of file it is, if it's invisible, locked, etc. Well, UNIX has it's own variant of these. They are
called "modes". Modes are a bit complicated. For example, if you type

%  ls -l

you will get:
rwx------  .login  01/08/98

(Or something like that.) Anyway, I'm trying to explain what those little "rwx"s in the corner mean. The characters in the corner are the modes. The "r" is for "read", the "w" for "write", and the "x" for "execute". There are also 9 slots, for 3 of each of these modes.
The first three slots are your access. (Obviously you would want full
access on all of your files!). The second three slots are your group members' access. The third set is the rest of the server's access.

NOTE: I never mentioned anything about groups before, but users can be categorized into groups to make assigning accounts easier... Much how HackAddict's groups
are divided into "Admin", "Co-Admin", "Regular User", and "Guest"... :)

Changing modes

To change a mode on a file, you use the following syntax:

% chmod "parameters" "filename"

The parameters can be simple like "+r", "+w", or "+x", or they can be
complicated like "731". The numbers are actually quite simple and convenient. I'll illustrate this:

r = 1
w = 2
x = 4

A neat mathematical thing to notice here is that adding these numbers up in different combinations can make new unique numbers. Unix knows this, which makes it easy to set
modes for all three sets of slots quickly:

example:

% chmod 744 game

This will give me read, write and execute access on my game, and everyone else on my server execute access.

NOTE: Do not give write access without read access. This is very weird.

hX: Hotline for UNIX!

hX is a wonderful creation from the good folks at Haxor, inc.
(More advertising :) hX is more like an IRC client, but it can connect to servers, post/read news, transfer files, and chat.

Installing

1. To install hX, first upload the compressed file to your shell using
Fetch, or ftp it from hx.haxor.com within your shell. 

*Make sure you have a "bin" directory in
your home directory. If you don't, type "cd ~" and then "mkdir bin".

2. Next, type "tar hx.tar.gz -zxf" and it will decompress. (Replace
"hX.tar.gz" with whatever you called it.)

3. Now, type "cd /hX/src" to move you into the source directory.

4. Now type "make makefile" and watch as UNIX compiles it for you. Don't ask me what all the stuff that scrolls up your screen means. (Not that I don't know of course, just that I'm too busy to tell you... Yeah... that's it...)

5. Now comes the fun part. Type "cd ~" to get into your home directory, and then "hx" to start it. Of course, you still don't know how to use it though... be patient...

Using hX

- Bookmarks

Making bookmarks is a good idea, because as far as I know, hX doesn't support the tracker. Meaning you have to know the addresses for all your servers. Anyway, bookmarks are stored in a directory called ".hX" in your home directory. Here's how you
create a bookmark:

1. Type "cd ~/.hX" to get yourself into your hX prefs directory.

2. Type "pico bookmarkname" (replace "bookmarkname" with the name of the bookmark.)

3. Now put the following information in the file:

    l=login
    p=password
    s=server address
    P=server port  (default = 5500)
    n=nickname

- Starting hX

The following command parameters are valid in hX:

hx [-s server] [-p port] [-n nickname] [-i icon] [-b bookmark] [--help]

Yes, even though you can't see your icon, typing "-i" and it's resource id will make it show up!

Most of hX's commands are either irc commands or ftp commands (both of which you should know anyway. :) I don't think I can justly reproduce the manual here, because it's as simple and easy to understand as possible. I strongly urge you to read it (you'll find it
in " ~/hX/doc/hX.1 ".

A few more notes on hX

The hX package comes with server and tracker programs as well. I
have know idea to how to use these, and I have no desire to learn either. I use hX mainly so I can visit HackAddict when I'm somewhere where I can telnet from such as the mall or library or
school. I guess I'd rather keep the running hotline servers to my trusty Mac, that's all. :) 

•Editor's Note: I included the entire hX archive from hx.haxor.com with this issue...Try it!

Some closing remarks

I'm quite afraid I delayed the arrival of Hackaddict 9, because of
a number of things:

- During the holidays I was away from my computer, with only a 286 to keepme company :(
- I got violently ill, and spent two days vomiting
- School all of a sudden got hard and I actually had to start paying attention.

Well, there are my excuses. My apologies go to The Weasel and all of you readers who devotedly logged on to HA every day to see if this issue had come yet. Well now I'm finally done. As soon as I finish typing this conclusion I'll send it to The Weasel. Right.
As soon as I finish typing. Just a few more words now... Type type
type... Aagh okay, I'm done. :)

- Fuzebox out.